package graficos;

import java.awt.Button;
import java.awt.Dimension;
import java.awt.Panel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;

public class Janela extends JFrame{
	
	public Janela(){
		
		Button bt1 = new Button("Botao Sair");
		bt1.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				System.exit(0);
			}
		});
		
		Button bt2 = new Button("Botao 2");
		Panel painel = new Panel();
		painel.add(bt1);
		painel.add(bt2);
		
		
		JFrame frame = new JFrame("Minha Janela");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.add(painel);
		frame.setExtendedState(MAXIMIZED_BOTH);//tamanho maximo
		Dimension d = new Dimension(800, 600);
		frame.setMinimumSize(d);//tamanho minino
		frame.setResizable(true);
		frame.pack();//deixa os componentes no menor tamanho possivel
		frame.setVisible(true);
		
		
	}
	
	public static void main(String[] args) {
		new Janela();
	}
}
